package dk.pun.dums.shared.character;

public class AgeBonus {
	
	public static final AgeBonus[] BONUSES = new AgeBonus[] {
		new AgeBonus(1, 1, 2, 1),
		new AgeBonus(2, 2, 3, 3),
		new AgeBonus(3, 3, 4, 6),
		new AgeBonus(4, 4, 5, 10),
		new AgeBonus(5, 5, 8, 15),
		new AgeBonus(6, 6, 10, 20),
		new AgeBonus(7, 7, 12, 25),
		new AgeBonus(8, 8, 15, 30),
		new AgeBonus(9, 9, 17, 35),
		new AgeBonus(10, 10, 20, 40)
	};
	
	public static AgeBonus getAgeBonus(final int ageBonus) {
		if (ageBonus < 1 || ageBonus > 10) {
			throw new IllegalArgumentException("Illegal age bonus: " + ageBonus + ". Age bonus must be 1-10.");
		}
		return AgeBonus.BONUSES[ageBonus-1];
	}
	
	private final transient int age;
	private final transient int mondaneTalent;
	private final transient int mondaneAdvantages;
	private final transient int ressources;
	
	public AgeBonus(final int age, final int talent, final int advantages, final int ressources) {
		this.age = age;
		this.mondaneTalent = talent;
		this.mondaneAdvantages = advantages;
		this.ressources = ressources;
	}

	public int getAge() {
		return age;
	}

	public int getMondaneTalent() {
		return mondaneTalent;
	}

	public int getMondaneAdvantages() {
		return mondaneAdvantages;
	}

	public int getRessources() {
		return ressources;
	}

}
